package bean;

import org.cloudfoundry.runtime.env.CloudEnvironment;
import org.cloudfoundry.runtime.env.RdbmsServiceInfo;


public class CloudDBConfigure implements DBConfigure {

	private String user;
	private String password;
	private String dbUrl;
	public CloudDBConfigure()
	{
		CloudEnvironment env = new CloudEnvironment();
		RdbmsServiceInfo mysqlInfo = env.getServiceInfo("mysql-4b32d", RdbmsServiceInfo.class);
        user = mysqlInfo.getUserName();
        password = mysqlInfo.getPassword();
        dbUrl = mysqlInfo.getUrl();
	}
	@Override
	public String getUrl() {
		return dbUrl;
	}

	@Override
	public String getUserName() {
		return user;
	}

	@Override
	public String getPassword() {
		return password;
	}

}
